<%@LANGUAGE="VBSCRIPT"%>
 
<!--#include file="functions.asp" -->

<%
set CompCode = Server.CreateObject("ADODB.Recordset")
CompCode.ActiveConnection = cn
CompCode.Source = "SELECT *  FROM dbo.COMPCODE"
'CompCode.CursorType = 0
'CompCode.CursorLocation = 2
'CompCode.LockType = 3
CompCode.Open()
CompCode_numRows = 0
%>
<%
Dim EXIREG__tmpNum
EXIREG__tmpNum = "0"
if (Request.QueryString("Seqnum") <> "") then EXIREG__tmpNum = Request.QueryString("Seqnum")
%>
<%
set EXIREG = Server.CreateObject("ADODB.Recordset")
EXIREG.ActiveConnection = cn
EXIREG.Source = "SELECT SEQNUM, REGNUM, INVNUM, VENDORID, INVRECDATE, INVDUEDATE, (SELECT TOP 1 VENDOR.NAME  FROM VENDOR  WHERE VENDOR.VENDORID=EXIREG.VENDORID) AS VENDORNAME,    (SELECT EMP.FIRSTNAME + ' '  + EMP.LASTNAME FROM dbo.EMP WHERE EXIREG.VERIFIEDBY=EMP.EMPCODE) AS VERNAME, (SELECT EMP.FIRSTNAME + ' '  + EMP.LASTNAME FROM dbo.EMP WHERE EXIREG.USERCOORD=EMP.EMPCODE) AS UCNAME,INVSTATUS, USERCOORD, VERIFIEDBY, USERDEPT, REFERENCEDOC, COMMENTS  FROM dbo.EXIREG  WHERE SEQNUM=" + Replace(EXIREG__tmpNum, "'", "''") + ""
EXIREG.Open()
EXIREG_numRows = 0
%>
<SCRIPT Language="JavaScript">

var InvStatus='<%= request.querystring("InvStatus") %>';
var dsort='<%= request.querystring("dsort") %>';
var dorder='<%= request.querystring("dorder") %>';
var Location='<%= request.querystring("Location") %>';
var UserCoord='<%= request.querystring("UserCoord") %>';
var RefOrder='<%= request.querystring("refOrder") %>';
var VendorID='<%= request.querystring("VendorID") %>';
var CurSymbol='<%= request.querystring("CurSymbol") %>';
var RecDate='<%= request.querystring("RecDate") %>';
var RecDate2='<%= request.querystring("RecDate2") %>';
var RptCond='<%= request.querystring("RptCond") %>';

function DocLoad(){
document.form1.reqEndUser.focus();
}
function CheckEmp(y)
{ if (y!="") {
window.open("ValEmpl.asp?EmpID="+y+"&src=document.form1.reqEndUser&fld=document.form1.empName&fld2=document.form1.Dept","","width=300,height=120,Top=240,Left=240,toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,resizable=no,")
} 
else 
{
document.form1.empName.value="";
document.form1.Dept.value="";}
}

function redirect(){
location='InvList.asp?InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&Location='+Location+'&UserCoord='+UserCoord+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;
return false
}
function register(){
location='Inv_Register.asp?InvStatus='+InvStatus+'&dsort='+ dsort+'&dorder='+ dorder+'&Location='+Location+'&UserCoord='+UserCoord+'&RefOrder='+RefOrder+'&VendorID='+VendorID+'&CurSymbol='+CurSymbol+'&RecDate='+RecDate+'&RecDate2='+RecDate2+'&RptCond='+RptCond;
return false
}
</SCRIPT>
<!-- #include file="pagetop.asp" -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td nowrap height="21" bgcolor="#FFFFFF" width="3%" background="images/menu_end.gif">&nbsp;</td>
    <td nowrap height="21" bgcolor="#FFFFFF" width="28"> 
      <div align="center"><img src="images/menu_awal_off.gif" width="28" height="33"></div>
    </td>
    <td width="10%" background="images/menuoff.gif" height="21" nowrap> 
      <div align="center"><b><a href="#" class="menu" onClick="return redirect()">Invoice 
        List</a></b></div>
    </td>
    <td nowrap height="21" width="28"><img src="images/menu_off_on_separator.gif" width="28" height="33"></td>
    <td width="12%" background="images/menuon.gif" height="21" nowrap> 
      <div align="center" class="menu">Routing &amp; Approval</div>
    </td>
    <td width="28" height="21" nowrap><img src="images/menu_on_off_separator.gif" width="28" height="33"></td>
    <td width="10%" background="images/menuoff.gif" height="21" nowrap> 
      <div align="center"><b class="menu"><a href="#" class="menu" onClick="return register()">Invoice 
        Register</a></b></div>
    </td>
    <td height="21" width="11" bgcolor="#FFFFFF"><img src="images/Menu_offend.gif" width="11" height="33"></td>
    <td height="21" bgcolor="#FFFFFF" background="images/menu_end.gif"> 
      <div align="right"><b></b> </div>
    </td>
  </tr>
  <tr bgcolor="#93bee2"> 
    <td height="21" width="3%" bgcolor="#93bee2">&nbsp;</td>
    <td height="21" width="28" bgcolor="#93bee2">&nbsp;</td>
    <td width="10%" height="21" bgcolor="#93bee2">&nbsp;</td>
    <td height="21" width="28">&nbsp;</td>
    <td width="10%" height="21">&nbsp;</td>
    <td width="28" height="21">&nbsp;</td>
    <td width="10%" height="21">&nbsp;</td>
    <td height="21" width="11">&nbsp;</td>
    <td height="21">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#93bee2">
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td>&nbsp; </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF"><img src="images/curv_data.gif" width="21" height="21"></td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <form name="form1" method="post" action="Route_process.asp" onSubmit="return checkrequired(this)">
        <table width="100%" border="0" cellspacing="2" cellpadding="3">
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Register No.:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td width="30%"> 
              <input type="text" name="RegNo" size="12" maxlength="12" class="InputBox" value="<%=(EXIREG.Fields.Item("REGNUM").Value)%>" readOnly=true>
              <input type="hidden" name="seqnum2" value="<%=(EXIREG.Fields.Item("SEQNUM").Value)%>">
              <input type="hidden" name="ty" value="<%= request.querystring("ty") %>">
              <input type="hidden" name="order" value="<%= request.querystring("order") %>">
              <input type="hidden" name="sort" value="<%= request.querystring("sort") %>">
              <input type="hidden" name="Route" value="<%= request.querystring("Route") %>">            </td>
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Invoice No.:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="InvoiceNo" size="25" maxlength="25" class="InputBox" value="<%=(EXIREG.Fields.Item("INVNUM").Value)%>" readOnly=true>            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Vendor ID:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td width="30%"> 
              <input type="text" name="VendorID2" size="12" maxlength="12" class="InputBox" value="<%=(EXIREG.Fields.Item("VENDORID").Value)%>" readOnly=true>            </td>
            <td width="15%" bgcolor="#FFFFFF"> 
              <div align="right"><b></b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Vendor Name:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"><input type="text" name="VendorName" size="50" maxlength="60" class="InputBox" value="<%=(EXIREG.Fields.Item("VENDORNAME").Value)%>" readonly=true></td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Received Date:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td width="30%"> 
              <input type="text" name="ReceivedDate" size="12" maxlength="12" class="InputBox" value="<%=(EXIREG.Fields.Item("INVRECDATE").Value)%>" readOnly=true>            </td>
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Invoice Status:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="DueDate" size="12" maxlength="12" class="InputBox" value="<%=(EXIREG.Fields.Item("INVSTATUS").Value)%>" readOnly=true>            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#FFFFFF"> 
              <div align="right"><b></b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td width="30%">&nbsp;</td>
            <td width="15%" bgcolor="#FFFFFF">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Route to 
                <% if (request.querystring("Route")="EU") then 
				usr= EXIREG.Fields.Item("VERIFIEDBY").Value 
				usrFull = EXIREG.Fields.Item("VERNAME").Value %>
                End User 
                <% else 
				usr= EXIREG.Fields.Item("USERCOORD").Value 
				usrFull = EXIREG.Fields.Item("UCNAME").Value %>
                User Coordinator 
                <% end if %>
                :&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td width="30%"> 
              <input type="text" name="reqEndUser" size="12" class="InputBox" value="<%= Usr %>" onBlur="CheckEmp(this.value);">
              <% if (request.querystring("Route")="EU") then %>
			  <input type="button" name="Submit2" value=" ... " onClick="openpopup('EmpList.asp?fName=form1.reqEndUser&fName2=form1.empName&fName3=form1.Dept')" class="sbttn">
              <% else %>
			  <input type="button" name="Submit2" value=" ... " onClick="openpopup('UCList.asp?fName=form1.reqEndUser&fName2=form1.empName&fName3=form1.Dept')" class="sbttn">
			  <% end if %>			</td>
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Department:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="Dept" size="15" class="InputBox" value="<%=(EXIREG.Fields.Item("USERDEPT").Value)%>">            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td width="30%"> 
              <input type="text" name="empName" size="30" class="InputBox" value="<%= usrFull %>">            </td>
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Route Date:</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td> 
              <input type="text" name="RouteDate" size="12" maxlength="12" class="InputBox" value="<%= date %>">
              <input type="button" name="Submit52" value=" ... " class="sbttn" onClick="javascript:show_calendar('form1.RouteDate')">            </td>
          </tr>
          <tr> 
            <td width="15%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td width="30%">&nbsp;</td>
            <td width="15%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Comments:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"> 
              <textarea name="Comments1" cols="60" rows="5" class="InputBoxCopy" readonly="true"><%=(EXIREG.Fields.Item("COMMENTS").Value)%></textarea>            </td>
          </tr>
          <tr>
            <td width="15%">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"><font color="#FF0000">Type your comments here:</font><br>
              <textarea name="Comments" cols="60" rows="3" class="InputBox"></textarea>            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Supporting Documents:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"> 
              <input type="text" name="reqSupDoc" size="60" class="InputBox" value="<%=(EXIREG.Fields.Item("REFERENCEDOC").Value)%>">
              <input type="button" name="btn1" value="Browse" onClick="opennew('LL_Browse.asp?fname=form1.reqSupDoc')" class="sbttn">            </td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#FFFFFF">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td width="30%"> 
              <input type="hidden" name="Location" value="<%= request.querystring("Location") %>">
              <input type="hidden" name="InvStatus" value="<%= request.querystring("InvStatus") %>">
              <input type="hidden" name="UserCoord" value="<%= request.querystring("UserCoord") %>">
              <input type="hidden" name="RefOrder" value="<%= request.querystring("RefOrder") %>">
              <input type="hidden" name="VendorID" value="<%= request.querystring("VendorID") %>">
              <input type="hidden" name="CurSymbol" value="<%= request.querystring("CurSymbol") %>">
              <input type="hidden" name="dsort" value="<%= Request.querystring("dsort") %>">
              <input type="hidden" name="dorder" value="<%= Request.querystring("dorder") %>">
              &nbsp;</td>
            <td width="15%" bgcolor="#FFFFFF">&nbsp;</td>
            <td width="2%">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td width="15%" bgcolor="#dedede"> 
              <div align="right"><b>Action:&nbsp;</b></div>            </td>
            <td width="2%">&nbsp;</td>
            <td colspan="4"> 
              <input type="submit" name="Submit" value=" Route Invoice " class="sbttn">
              <input type="button" name="Submit4" value=" Back " class="sbttn" onClick="history.go(-1)">
              <div align="right"><b> </b></div>            </td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
  <tr> 
    <td width="4%">&nbsp;</td>
    <td width="2%" bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
CompCode.Close()
%>
<%
EXIREG.Close()
%>
